package com.atguigu.cf.test;

import java.util.concurrent.CompletableFuture;
import java.util.concurrent.ExecutorService;

/**
 * author: 封捷
 * date: 2023/1/29 16:32
 * version: 1.0
 */
public class Demo01TaskNoResult {

    public static void main(String[] args) {
        // 1、获取线程池对象
        ExecutorService threadPool = ThreadPoolProvider.getThreadPool();

        // 2、使用 CompletableFuture 封装一个没有返回值的任务
        CompletableFuture.runAsync(()->{
            System.out.println("当前线程名称：" + Thread.currentThread().getName());
        }, threadPool);
    }

}
